package org.kl.wx.entity;

import java.sql.Timestamp;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.kl.bf.entity.AuditableEntity;
import org.kl.bf.entity.Excel;

import com.fasterxml.jackson.annotation.JsonFormat;

@Entity
@Table(name = "wx_message_result")
public class MessageResult extends AuditableEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6414663231834599066L;
	@Excel(exportName = "所属公共账号", exportProperty = "appName")
	private App app;
	@Excel(exportName = "接收方账号")
	private String toUserName;
	@Excel(exportName = "发送方帐号")
	private String fromUserName;
	@Excel(exportName = "创建时间的时间戳")
	private Timestamp msgCreateTime;
	@Excel(exportName = "消息类型")
	private String msgType;
	@Excel(exportName = "事件信息")
	private String event;
	@Excel(exportName = "消息ID")
	private String msgId;
	@Excel(exportName = "消息状态")
	private String msgStatus;
	@Excel(exportName = "总粉丝数")
	private Integer totalCount = 0;
	@Excel(exportName = "准备发送的粉丝数")
	private Integer filterCount = 0;
	@Excel(exportName = "发送成功的粉丝数")
	private Integer sentCount = 0;
	@Excel(exportName = "发送失败的粉丝数")
	private Integer errorCount = 0;

	public MessageResult() {
	}

	public MessageResult(String id) {
		this.id = id;
	}

	@ManyToOne
	@JoinColumn(name = "app_id")
	public App getApp() {
		return app;
	}

	public void setApp(App app) {
		this.app = app;
	}

	public String getToUserName() {
		return toUserName;
	}

	public void setToUserName(String toUserName) {
		this.toUserName = toUserName;
	}

	public String getFromUserName() {
		return fromUserName;
	}

	public void setFromUserName(String fromUserName) {
		this.fromUserName = fromUserName;
	}

	@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+08:00")
	public Timestamp getMsgCreateTime() {
		return msgCreateTime;
	}

	public void setMsgCreateTime(Timestamp msgCreateTime) {
		this.msgCreateTime = msgCreateTime;
	}

	public String getMsgType() {
		return msgType;
	}

	public void setMsgType(String msgType) {
		this.msgType = msgType;
	}

	public String getEvent() {
		return event;
	}

	public void setEvent(String event) {
		this.event = event;
	}

	public String getMsgId() {
		return msgId;
	}

	public void setMsgId(String msgId) {
		this.msgId = msgId;
	}

	public String getMsgStatus() {
		return msgStatus;
	}

	public void setMsgStatus(String msgStatus) {
		this.msgStatus = msgStatus;
	}

	public Integer getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(Integer totalCount) {
		this.totalCount = totalCount;
	}

	public Integer getFilterCount() {
		return filterCount;
	}

	public void setFilterCount(Integer filterCount) {
		this.filterCount = filterCount;
	}

	public Integer getSentCount() {
		return sentCount;
	}

	public void setSentCount(Integer sentCount) {
		this.sentCount = sentCount;
	}

	public Integer getErrorCount() {
		return errorCount;
	}

	public void setErrorCount(Integer errorCount) {
		this.errorCount = errorCount;
	}

}
